home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: string and NULL :ques
- Date: 21 Feb 1996 15:03:29 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4gg8c1INNimh@keats.ugrad.cs.ubc.ca>
- References: <4g5flf$bil@gail.ripco.com> <4gd60bINNk22@keats.ugrad.cs.ubc.ca> <Pine.A32.3.91.960221002007.156335F-100000@black.weeg.uiowa.edu>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <Pine.A32.3.91.960221002007.156335F-100000@black.weeg.uiowa.edu>,
- The Amorphous Mass <robinson@blue.weeg.uiowa.edu> wrote:
- >On 20 Feb 1996, Kazimir Kylheku wrote:
- >
- >> In article <4g5flf$bil@gail.ripco.com>,
- >> Martin Ambuhl <mambuhl@ripco.com> wrote:
- >> >If you want to work on a char array which does not contain a null
- >> >character, how do you propose to tell the library functions where it
- >> >ends?
- >> >
- >> >One possible result of using the library functions on such a char array
- >> >is a segfault. On M$BrokenOS, the results are completely unpredictable,
- >> >since there is no protection against access (including writing) of
- >> >regions containing other data, your program, or even portions of the OS.
- >>
- >> Well, even under a good OS, you still can only detect overruns to the accuracy
- >> of a page size.
- >
- > And under VMS, you can detect overruns immediately past the end of the
- >array. That's one of the admittedly few things I like about coding on
- >VMS. ;)
-
- This is probably a benefit of a segmented and paged architecture to which VMS
- is tied. It is not portable to all memory management hardware. You can do it
- under 80386 and its offspring, but you only have a limited number of segments
- available in the descriptor table, so the number of objects that can thus be
- protected is extremely limited in comparison to the address space. Such
- segmentation might not even be available at all on your typical RISC machine.
- --
-
-